package com.c1802.action;

import com.c1802.entity.User;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

public class MyAction extends ActionSupport {

    @Override
    public String execute() throws Exception {
        HttpServletRequest request= ServletActionContext.getRequest();
        User user=null;
        user=(User) request.getSession().getAttribute("user");
        System.out.println(user);
        if(user!=null){
            return "success";
        }else{
            return "error";
        }
    }
}
